gdkdnd: Add private means to commit the drag status
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 9 Mar 2016 16:00:31 +0000 (17:00 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 14 Mar 2016 15:50:36 +0000 (16:50 +0100)
commit2923f69d3cc3a3518b847c8d91e5003584cb50f9
tree2f1c2aa3a708c4f0a48507f92608273a7069c976
parent160a4fe5ac3ff8d857c4dcc90f81a51cd133ab61
gdkdnd: Add private means to commit the drag status

The way gdk_drag_status() may be called multiple times during the
processing of drag and drop events throughout the widget hierarchy
brings some superfluous messaging going in, esp. when it's the last
request the one we want to honor, yet we emit messaging requests on
all.

This is barely appreciable in the X11 backend, but due to the design
of the wayland protocol, quick series of changes like this it have
some self-amplificating consequences which may end up flooding the
connection.

We can delegate this to a late "commit" call, performed within GDK
event management. This way gdk_drag_status() calls may be cached
and only result in windowing messaging once per ::drag-motion or
::drag-data-received event. Emitting the final status will also
avoid spurious action changes on the compositor and the other peer.

https://bugzilla.gnome.org/show_bug.cgi?id=763298
gdk/gdkdnd.c
gdk/gdkdndprivate.h
gdk/gdkevents.c
gdk/wayland/gdkdnd-wayland.c